package com.uuah.server.config.spring.parsers;

import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;

/**
 * This is the interface all Uuah BDPs implement. It is a bit odd because it had
 * to be retro-fitted to existing code. In particular
 * {@link org.springframework.beans.factory.xml.BeanDefinitionParser#parse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)}
 * and
 * {@link #uuahParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)}
 * seem to duplicate each other. This is because many Uuah classes subclass a
 * Spring helper which makes parse() final. So instead we need to use
 * {@link #uuahParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)}
 * , to allow over-rides.
 *
 * <p>
 * In case that's not clear - always call
 * {@link # uuahParse (org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)}
 * rather than
 * {@link org.springframework.beans.factory.xml.BeanDefinitionParser#parse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)}
 * . The {@link org.springframework.beans.factory.xml.BeanDefinitionParser} is
 * here only to allow the BDP to be handed over to Spring.
 */
public interface IUuahDefinitionParser extends BeanDefinitionParser,
		IUuahDefinitionParserConfiguration {

	AbstractBeanDefinition uuahParse(Element element, ParserContext parserContext);

	String getBeanName(Element element);

}
